import {CSSProperties, useCallback} from "react";
import Taro from "@tarojs/taro";
import classNames from "classnames";
import {View} from "@tarojs/components";
import styles from "./index.module.scss";

interface Props{
  className?: CSSProperties;
  style?: CSSProperties;
}

export function Stall(props: Props){

  const toDetail = useCallback(()=>{
    Taro.navigateTo({url: '/pages/detail/index'});
  }, []);

  return (
    <View
      className={classNames(styles.stall, props.className)}
      style={props.style}
      onClick={toDetail}
    >
      <View className={styles.headPart}>
        <View className={styles.pic} />
        <View className={styles.desc}>
          <View className={styles.title}>这家烤面筋</View>
          <View >烤面筋 烤苕皮 烤豆干</View>
          <View >168人推荐/标记</View>
        </View>
      </View>
      <View className={styles.btmComment}>
        <View className={styles.avatar} />
        <View className={styles.comment}>上次去买烤面筋，多扯了一张纸巾老板娘就不安逸我了...</View>
      </View>
    </View>
  );
}
